package com.im.model;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName = "xmpp_message")
public class XmppMessage {

	public static final int MSG_TYPE_TEXT = 1;
	public static final int MSG_TYPE_IMG = 2;
	public static final int MSG_TYPE_AUDIO = 3;
	public static final int MSG_TYPE_OTHER = 0;

	@DatabaseField(columnName = "id", generatedId = true)
	private int id;

	/** 0:other 1:Text 2:img 3:audio */
	@DatabaseField(columnName = "msg_type", canBeNull = false)
	private int msgType;

	@DatabaseField(columnName = "msg_content", canBeNull = false)
	private String msgContent;

	@DatabaseField(columnName = "create_time", canBeNull = false)
	private long createTime;

	@DatabaseField(columnName = "from_user", canBeNull = false)
	private String fromUser;

	@DatabaseField(columnName = "to_user", canBeNull = false)
	private String toUser;

	@DatabaseField(columnName = "readed")
	private boolean readed = false;
	
	@DatabaseField(columnName="description")
	private String desc = null;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getMsgType() {
		return msgType;
	}

	public void setMsgType(int msgType) {
		this.msgType = msgType;
	}

	public String getMsgContent() {
		return msgContent;
	}

	public void setMsgContent(String msgContent) {
		this.msgContent = msgContent;
	}

	public long getCreateTime() {
		return createTime;
	}

	public void setCreateTime(long createTime) {
		this.createTime = createTime;
	}

	public boolean isReaded() {
		return readed;
	}

	public void setReaded(boolean readed) {
		this.readed = readed;
	}

	public String getFromUser() {
		return fromUser;
	}

	public void setFromUser(String fromUser) {
		this.fromUser = fromUser;
	}

	public String getToUser() {
		return toUser;
	}

	public void setToUser(String toUser) {
		this.toUser = toUser;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public XmppMessage() {
		super();
	}
	
	public XmppMessage(String msgContent, String fromUser, String toUser,boolean readed,int msgType) {
		super();
		this.msgContent = msgContent;
		this.fromUser = fromUser;
		this.toUser = toUser;
		this.msgType = msgType;
		this.createTime = System.currentTimeMillis();
		this.readed = readed;
	}

}
